package org.stragma.symbian.apply.stratego;

import org.strategoxt.stratego_lib.*;
import org.strategoxt.stratego_lib.*;
import org.strategoxt.lang.*;
import org.spoofax.interpreter.terms.*;
import static org.strategoxt.lang.Term.*;
import org.spoofax.interpreter.library.AbstractPrimitive;
import java.util.ArrayList;
import java.lang.ref.WeakReference;

@SuppressWarnings("all") public class Doapply  
{ 
  protected static final boolean TRACES_ENABLED = true;

  protected static ITermFactory constantFactory;

  private static WeakReference<Context> initedContext;

  private static boolean isIniting;

  protected static IStrategoTerm constIndex0;

  protected static IStrategoTerm constRowColumn0;

  protected static IStrategoTerm const5;

  protected static IStrategoTerm const4;

  protected static IStrategoTerm constComma0;

  protected static IStrategoTerm const3;

  protected static IStrategoTerm const2;

  protected static IStrategoTerm constCons0;

  protected static IStrategoTerm constDR_DUMMY0;

  protected static IStrategoTerm constNil0;

  protected static IStrategoTerm const1;

  protected static IStrategoTerm const0;

  public static IStrategoConstructor _consConc_2;

  public static IStrategoConstructor _consNone_0;

  public static IStrategoConstructor _consSome_1;

  public static IStrategoConstructor _consDR_DUMMY_0;

  public static IStrategoConstructor _consInt_1;

  public static IStrategoConstructor _consComma_2;

  public static IStrategoConstructor _consRange_2;

  public static IStrategoConstructor _consVar_1;

  public static IStrategoConstructor _consFunc_2;

  public static IStrategoConstructor _consProcedure_5;

  public static IStrategoConstructor _consWindowArray_3;

  public static IStrategoConstructor _consWindow_1;

  public static IStrategoConstructor _consStatements_1;

  public static IStrategoConstructor _consApplyLoop_6;

  public static IStrategoConstructor _consRowColumn_0;

  public static IStrategoConstructor _consIndex_0;

  public static IStrategoConstructor _consAccess_2;

  public static IStrategoConstructor _consArgument_2;

  public static IStrategoConstructor _consWindowAccessElement_7;

  public static IStrategoConstructor _consWindowAccessElement_6;

  public static IStrategoConstructor _consWindowAccessScalar_3;

  public static IStrategoConstructor _consWindowAccessScalar_2;

  public static Context init(Context context)
  { 
    synchronized(Doapply.class)
    { 
      if(isIniting)
        return null;
      try
      { 
        isIniting = true;
        ITermFactory termFactory = context.getFactory();
        if(constantFactory == null)
        { 
          initConstructors(termFactory);
          initConstants(termFactory);
        }
        if(initedContext == null || initedContext.get() != context)
        { 
          org.strategoxt.stratego_lib.Main.init(context);
          org.strategoxt.stratego_lib.Main.init(context);
          context.registerComponent("Doapply");
        }
        initedContext = new WeakReference<Context>(context);
        constantFactory = termFactory;
      }
      finally
      { 
        isIniting = false;
      }
      return context;
    }
  }

  public static Context init()
  { 
    return init(new Context());
  }

  public static void main(String args[])
  { 
    Context context = init();
    context.setStandAlone(true);
    try
    { 
      IStrategoTerm result;
      try
      { 
        result = context.invokeStrategyCLI(io_$Doapply_0_0.instance, "Doapply", args);
      }
      finally
      { 
        context.getIOAgent().closeAllFiles();
      }
      if(result == null)
      { 
        System.err.println("Doapply" + (TRACES_ENABLED ? ": rewriting failed, trace:" : ": rewriting failed"));
        context.printStackTrace();
        context.setStandAlone(false);
        System.exit(1);
      }
      else
      { 
        //System.out.println(result);
        context.setStandAlone(false);
        System.exit(0);
      }
    }
    catch(StrategoExit exit)
    { 
      context.setStandAlone(false);
      //System.exit(exit.getValue());
    }
  }

  public static IStrategoTerm mainNoExit(String ... args) throws StrategoExit
  { 
    return mainNoExit(new Context(), args);
  }

  public static IStrategoTerm mainNoExit(Context context, String ... args) throws StrategoExit
  { 
    try
    { 
      init(context);
      return context.invokeStrategyCLI(io_$Doapply_0_0.instance, "Doapply", args);
    }
    finally
    { 
      context.getIOAgent().closeAllFiles();
    }
  }

  public static Strategy getMainStrategy()
  { 
    return io_$Doapply_0_0.instance;
  }

  public static void initConstructors(ITermFactory termFactory)
  { 
    _consConc_2 = termFactory.makeConstructor("Conc", 2);
    _consNone_0 = termFactory.makeConstructor("None", 0);
    _consSome_1 = termFactory.makeConstructor("Some", 1);
    _consDR_DUMMY_0 = termFactory.makeConstructor("DR_DUMMY", 0);
    _consInt_1 = termFactory.makeConstructor("Int", 1);
    _consComma_2 = termFactory.makeConstructor("Comma", 2);
    _consRange_2 = termFactory.makeConstructor("Range", 2);
    _consVar_1 = termFactory.makeConstructor("Var", 1);
    _consFunc_2 = termFactory.makeConstructor("Func", 2);
    _consProcedure_5 = termFactory.makeConstructor("Procedure", 5);
    _consWindowArray_3 = termFactory.makeConstructor("WindowArray", 3);
    _consWindow_1 = termFactory.makeConstructor("Window", 1);
    _consStatements_1 = termFactory.makeConstructor("Statements", 1);
    _consApplyLoop_6 = termFactory.makeConstructor("ApplyLoop", 6);
    _consRowColumn_0 = termFactory.makeConstructor("RowColumn", 0);
    _consIndex_0 = termFactory.makeConstructor("Index", 0);
    _consAccess_2 = termFactory.makeConstructor("Access", 2);
    _consArgument_2 = termFactory.makeConstructor("Argument", 2);
    _consWindowAccessElement_7 = termFactory.makeConstructor("WindowAccessElement", 7);
    _consWindowAccessElement_6 = termFactory.makeConstructor("WindowAccessElement", 6);
    _consWindowAccessScalar_3 = termFactory.makeConstructor("WindowAccessScalar", 3);
    _consWindowAccessScalar_2 = termFactory.makeConstructor("WindowAccessScalar", 2);
  }

  public static void initConstants(ITermFactory termFactory)
  { 
    const0 = termFactory.makeString("0");
    const1 = termFactory.makeString("WindowScalar");
    constNil0 = (IStrategoTerm)termFactory.makeList();
    constDR_DUMMY0 = termFactory.makeAppl(Doapply._consDR_DUMMY_0, NO_TERMS);
    constCons0 = (IStrategoTerm)termFactory.makeListCons(Doapply.constDR_DUMMY0, (IStrategoList)Doapply.constNil0);
    const2 = termFactory.makeString("175732");
    const3 = termFactory.makeString("WindowElement");
    constComma0 = termFactory.makeAppl(Doapply._consComma_2, new IStrategoTerm[]{Doapply.constCons0, Doapply.constCons0});
    const4 = termFactory.annotateTerm(Doapply.constComma0, checkListAnnos(termFactory, Doapply.constCons0));
    const5 = termFactory.makeString("-8183");
    constRowColumn0 = termFactory.makeAppl(Doapply._consRowColumn_0, NO_TERMS);
    constIndex0 = termFactory.makeAppl(Doapply._consIndex_0, NO_TERMS);
  }

  @SuppressWarnings("all") public static class topdownstopping_1_0 extends Strategy 
  { 
    public static topdownstopping_1_0 instance = new topdownstopping_1_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term, Strategy s_7)
    { 
      context.push("topdownstopping_1_0");
      Fail0:
      { 
        IStrategoTerm term0 = term;
        Success0:
        { 
          Fail1:
          { 
            term = s_7.invoke(context, term);
            if(term == null)
              break Fail1;
            if(true)
              break Success0;
          }
          term = term0;
          lifted0 lifted00 = new lifted0();
          lifted00.s_7 = s_7;
          term = SRTS_all.instance.invoke(context, term, lifted00);
          if(term == null)
            break Fail0;
        }
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class minstring_0_0 extends Strategy 
  { 
    public static minstring_0_0 instance = new minstring_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      ITermFactory termFactory = context.getFactory();
      context.push("minstring_0_0");
      Fail2:
      { 
        IStrategoTerm t_7 = null;
        IStrategoTerm u_7 = null;
        if(term.getTermType() != IStrategoTerm.TUPLE || term.getSubtermCount() != 2)
          break Fail2;
        t_7 = term.getSubterm(0);
        u_7 = term.getSubterm(1);
        Success1:
        { 
          Fail3:
          { 
            IStrategoTerm v_7 = null;
            v_7 = term;
            term = termFactory.makeTuple(t_7, u_7);
            term = leq$S_0_0.instance.invoke(context, term);
            if(term == null)
              break Fail3;
            term = v_7;
            { 
              term = t_7;
              if(true)
                break Success1;
            }
          }
          term = u_7;
        }
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class maxstring_0_0 extends Strategy 
  { 
    public static maxstring_0_0 instance = new maxstring_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      ITermFactory termFactory = context.getFactory();
      context.push("maxstring_0_0");
      Fail4:
      { 
        IStrategoTerm w_7 = null;
        IStrategoTerm x_7 = null;
        if(term.getTermType() != IStrategoTerm.TUPLE || term.getSubtermCount() != 2)
          break Fail4;
        w_7 = term.getSubterm(0);
        x_7 = term.getSubterm(1);
        Success2:
        { 
          Fail5:
          { 
            IStrategoTerm y_7 = null;
            y_7 = term;
            term = termFactory.makeTuple(w_7, x_7);
            term = geq$S_0_0.instance.invoke(context, term);
            if(term == null)
              break Fail5;
            term = y_7;
            { 
              term = w_7;
              if(true)
                break Success2;
            }
          }
          term = x_7;
        }
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class io_$Doapply_0_0 extends Strategy 
  { 
    public static io_$Doapply_0_0 instance = new io_$Doapply_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("io_Doapply_0_0");
      Fail6:
      { 
        term = io_wrap_1_0.instance.invoke(context, term, $Apply__$Doapply_0_0.instance);
        if(term == null)
          break Fail6;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class $Apply__$Doapply_0_0 extends Strategy 
  { 
    public static $Apply__$Doapply_0_0 instance = new $Apply__$Doapply_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("Apply__Doapply_0_0");
      Fail7:
      { 
        term = topdownstopping_1_0.instance.invoke(context, term, add_loop_0_0.instance);
        if(term == null)
          break Fail7;
        term = bottomup_1_0.instance.invoke(context, term, lifted4.instance);
        if(term == null)
          break Fail7;
        term = topdownstopping_1_0.instance.invoke(context, term, propagate_looptype_0_0.instance);
        if(term == null)
          break Fail7;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class collect_windows_0_0 extends Strategy 
  { 
    public static collect_windows_0_0 instance = new collect_windows_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("collect_windows_0_0");
      Fail8:
      { 
        TermReference l_8 = new TermReference();
        TermReference m_8 = new TermReference();
        TermReference n_8 = new TermReference();
        lifted7 lifted70 = new lifted7();
        lifted70.l_8 = l_8;
        lifted70.m_8 = m_8;
        lifted70.n_8 = n_8;
        term = collect_1_0.instance.invoke(context, term, lifted70);
        if(term == null)
          break Fail8;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class select_rs_0_0 extends Strategy 
  { 
    public static select_rs_0_0 instance = new select_rs_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail9:
      { 
        IStrategoTerm s_8 = null;
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consWindowArray_3 != ((IStrategoAppl)term).getConstructor())
          break Fail9;
        IStrategoTerm arg0 = term.getSubterm(0);
        if(arg0.getTermType() != IStrategoTerm.APPL || Doapply._consRange_2 != ((IStrategoAppl)arg0).getConstructor())
          break Fail9;
        IStrategoTerm arg1 = arg0.getSubterm(0);
        if(arg1.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg1).getConstructor())
          break Fail9;
        s_8 = arg1.getSubterm(0);
        IStrategoTerm arg2 = arg0.getSubterm(1);
        if(arg2.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg2).getConstructor())
          break Fail9;
        IStrategoTerm arg3 = term.getSubterm(1);
        if(arg3.getTermType() != IStrategoTerm.APPL || Doapply._consRange_2 != ((IStrategoAppl)arg3).getConstructor())
          break Fail9;
        IStrategoTerm arg4 = arg3.getSubterm(0);
        if(arg4.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg4).getConstructor())
          break Fail9;
        IStrategoTerm arg5 = arg3.getSubterm(1);
        if(arg5.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg5).getConstructor())
          break Fail9;
        term = s_8;
        if(true)
          return term;
      }
      context.push("select_rs_0_0");
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class select_re_0_0 extends Strategy 
  { 
    public static select_re_0_0 instance = new select_re_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail10:
      { 
        IStrategoTerm x_8 = null;
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consWindowArray_3 != ((IStrategoAppl)term).getConstructor())
          break Fail10;
        IStrategoTerm arg6 = term.getSubterm(0);
        if(arg6.getTermType() != IStrategoTerm.APPL || Doapply._consRange_2 != ((IStrategoAppl)arg6).getConstructor())
          break Fail10;
        IStrategoTerm arg7 = arg6.getSubterm(0);
        if(arg7.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg7).getConstructor())
          break Fail10;
        IStrategoTerm arg8 = arg6.getSubterm(1);
        if(arg8.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg8).getConstructor())
          break Fail10;
        x_8 = arg8.getSubterm(0);
        IStrategoTerm arg9 = term.getSubterm(1);
        if(arg9.getTermType() != IStrategoTerm.APPL || Doapply._consRange_2 != ((IStrategoAppl)arg9).getConstructor())
          break Fail10;
        IStrategoTerm arg10 = arg9.getSubterm(0);
        if(arg10.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg10).getConstructor())
          break Fail10;
        IStrategoTerm arg11 = arg9.getSubterm(1);
        if(arg11.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg11).getConstructor())
          break Fail10;
        term = x_8;
        if(true)
          return term;
      }
      context.push("select_re_0_0");
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class select_cs_0_0 extends Strategy 
  { 
    public static select_cs_0_0 instance = new select_cs_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail11:
      { 
        IStrategoTerm c_9 = null;
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consWindowArray_3 != ((IStrategoAppl)term).getConstructor())
          break Fail11;
        IStrategoTerm arg12 = term.getSubterm(0);
        if(arg12.getTermType() != IStrategoTerm.APPL || Doapply._consRange_2 != ((IStrategoAppl)arg12).getConstructor())
          break Fail11;
        IStrategoTerm arg13 = arg12.getSubterm(0);
        if(arg13.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg13).getConstructor())
          break Fail11;
        IStrategoTerm arg14 = arg12.getSubterm(1);
        if(arg14.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg14).getConstructor())
          break Fail11;
        IStrategoTerm arg15 = term.getSubterm(1);
        if(arg15.getTermType() != IStrategoTerm.APPL || Doapply._consRange_2 != ((IStrategoAppl)arg15).getConstructor())
          break Fail11;
        IStrategoTerm arg16 = arg15.getSubterm(0);
        if(arg16.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg16).getConstructor())
          break Fail11;
        c_9 = arg16.getSubterm(0);
        IStrategoTerm arg17 = arg15.getSubterm(1);
        if(arg17.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg17).getConstructor())
          break Fail11;
        term = c_9;
        if(true)
          return term;
      }
      context.push("select_cs_0_0");
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class select_ce_0_0 extends Strategy 
  { 
    public static select_ce_0_0 instance = new select_ce_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail12:
      { 
        IStrategoTerm h_9 = null;
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consWindowArray_3 != ((IStrategoAppl)term).getConstructor())
          break Fail12;
        IStrategoTerm arg18 = term.getSubterm(0);
        if(arg18.getTermType() != IStrategoTerm.APPL || Doapply._consRange_2 != ((IStrategoAppl)arg18).getConstructor())
          break Fail12;
        IStrategoTerm arg19 = arg18.getSubterm(0);
        if(arg19.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg19).getConstructor())
          break Fail12;
        IStrategoTerm arg20 = arg18.getSubterm(1);
        if(arg20.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg20).getConstructor())
          break Fail12;
        IStrategoTerm arg21 = term.getSubterm(1);
        if(arg21.getTermType() != IStrategoTerm.APPL || Doapply._consRange_2 != ((IStrategoAppl)arg21).getConstructor())
          break Fail12;
        IStrategoTerm arg22 = arg21.getSubterm(0);
        if(arg22.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg22).getConstructor())
          break Fail12;
        IStrategoTerm arg23 = arg21.getSubterm(1);
        if(arg23.getTermType() != IStrategoTerm.APPL || Doapply._consInt_1 != ((IStrategoAppl)arg23).getConstructor())
          break Fail12;
        h_9 = arg23.getSubterm(0);
        term = h_9;
        if(true)
          return term;
      }
      context.push("select_ce_0_0");
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class min_rs_0_0 extends Strategy 
  { 
    public static min_rs_0_0 instance = new min_rs_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("min_rs_0_0");
      Fail13:
      { 
        term = foldr_3_0.instance.invoke(context, term, lifted8.instance, minstring_0_0.instance, select_rs_0_0.instance);
        if(term == null)
          break Fail13;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class max_re_0_0 extends Strategy 
  { 
    public static max_re_0_0 instance = new max_re_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("max_re_0_0");
      Fail14:
      { 
        term = foldr_3_0.instance.invoke(context, term, lifted11.instance, maxstring_0_0.instance, select_re_0_0.instance);
        if(term == null)
          break Fail14;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class min_cs_0_0 extends Strategy 
  { 
    public static min_cs_0_0 instance = new min_cs_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("min_cs_0_0");
      Fail15:
      { 
        term = foldr_3_0.instance.invoke(context, term, lifted14.instance, minstring_0_0.instance, select_cs_0_0.instance);
        if(term == null)
          break Fail15;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class max_ce_0_0 extends Strategy 
  { 
    public static max_ce_0_0 instance = new max_ce_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("max_ce_0_0");
      Fail16:
      { 
        term = foldr_3_0.instance.invoke(context, term, lifted17.instance, maxstring_0_0.instance, select_ce_0_0.instance);
        if(term == null)
          break Fail16;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class collection_extreme_dimensions_0_0 extends Strategy 
  { 
    public static collection_extreme_dimensions_0_0 instance = new collection_extreme_dimensions_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      ITermFactory termFactory = context.getFactory();
      context.push("collection_extreme_dimensions_0_0");
      Fail17:
      { 
        IStrategoTerm i_9 = null;
        IStrategoTerm j_9 = null;
        IStrategoTerm k_9 = null;
        IStrategoTerm l_9 = null;
        i_9 = term;
        term = min_rs_0_0.instance.invoke(context, i_9);
        if(term == null)
          break Fail17;
        j_9 = term;
        term = max_re_0_0.instance.invoke(context, i_9);
        if(term == null)
          break Fail17;
        k_9 = term;
        term = min_cs_0_0.instance.invoke(context, i_9);
        if(term == null)
          break Fail17;
        l_9 = term;
        term = max_ce_0_0.instance.invoke(context, i_9);
        if(term == null)
          break Fail17;
        term = termFactory.makeTuple(termFactory.makeAppl(Doapply._consInt_1, new IStrategoTerm[]{j_9}), termFactory.makeAppl(Doapply._consInt_1, new IStrategoTerm[]{k_9}), termFactory.makeAppl(Doapply._consInt_1, new IStrategoTerm[]{l_9}), termFactory.makeAppl(Doapply._consInt_1, new IStrategoTerm[]{term}));
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class argument_extreme_dimensions_0_0 extends Strategy 
  { 
    public static argument_extreme_dimensions_0_0 instance = new argument_extreme_dimensions_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("argument_extreme_dimensions_0_0");
      Fail18:
      { 
        term = collect_windows_0_0.instance.invoke(context, term);
        if(term == null)
          break Fail18;
        term = collection_extreme_dimensions_0_0.instance.invoke(context, term);
        if(term == null)
          break Fail18;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class window_declaration_0_0 extends Strategy 
  { 
    public static window_declaration_0_0 instance = new window_declaration_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      ITermFactory termFactory = context.getFactory();
      context.push("window_declaration_0_0");
      Fail19:
      { 
        IStrategoTerm term3 = term;
        IStrategoConstructor cons0 = term.getTermType() == IStrategoTerm.APPL ? ((IStrategoAppl)term).getConstructor() : null;
        Success3:
        { 
          if(cons0 == Doapply._consArgument_2)
          { 
            Fail20:
            { 
              IStrategoTerm g_10 = null;
              IStrategoTerm h_10 = null;
              IStrategoTerm i_10 = null;
              IStrategoTerm j_10 = null;
              IStrategoTerm k_10 = null;
              IStrategoTerm m_10 = null;
              IStrategoTerm n_10 = null;
              IStrategoTerm o_10 = null;
              IStrategoTerm arg24 = term.getSubterm(0);
              if(arg24.getTermType() != IStrategoTerm.APPL || Doapply._consVar_1 != ((IStrategoAppl)arg24).getConstructor())
                break Fail20;
              g_10 = arg24.getSubterm(0);
              IStrategoTerm arg25 = term.getSubterm(1);
              if(arg25.getTermType() != IStrategoTerm.APPL || Doapply._consAccess_2 != ((IStrategoAppl)arg25).getConstructor())
                break Fail20;
              IStrategoTerm arg26 = arg25.getSubterm(1);
              if(arg26.getTermType() != IStrategoTerm.APPL || Doapply._consWindow_1 != ((IStrategoAppl)arg26).getConstructor())
                break Fail20;
              h_10 = arg26.getSubterm(0);
              i_10 = term;
              m_10 = term;
              j_10 = Doapply.const1;
              n_10 = m_10;
              term = termFactory.annotateTerm(termFactory.makeAppl(Doapply._consVar_1, new IStrategoTerm[]{g_10}), checkListAnnos(termFactory, Doapply.constCons0));
              k_10 = term;
              o_10 = n_10;
              term = termFactory.makeTuple(Doapply.const2, g_10, h_10);
              term = dr_set_rule_0_3.instance.invoke(context, o_10, j_10, k_10, term);
              if(term == null)
                break Fail20;
              term = i_10;
              if(true)
                break Success3;
            }
            term = term3;
          }
          if(cons0 == Doapply._consArgument_2)
          { 
            IStrategoTerm t_9 = null;
            IStrategoTerm u_9 = null;
            IStrategoTerm v_9 = null;
            IStrategoTerm w_9 = null;
            IStrategoTerm x_9 = null;
            IStrategoTerm y_9 = null;
            IStrategoTerm z_9 = null;
            IStrategoTerm b_10 = null;
            IStrategoTerm c_10 = null;
            IStrategoTerm d_10 = null;
            IStrategoTerm arg27 = term.getSubterm(0);
            if(arg27.getTermType() != IStrategoTerm.APPL || Doapply._consVar_1 != ((IStrategoAppl)arg27).getConstructor())
              break Fail19;
            t_9 = arg27.getSubterm(0);
            IStrategoTerm arg28 = term.getSubterm(1);
            if(arg28.getTermType() != IStrategoTerm.APPL || Doapply._consAccess_2 != ((IStrategoAppl)arg28).getConstructor())
              break Fail19;
            IStrategoTerm arg29 = arg28.getSubterm(1);
            if(arg29.getTermType() != IStrategoTerm.APPL || Doapply._consWindowArray_3 != ((IStrategoAppl)arg29).getConstructor())
              break Fail19;
            u_9 = arg29.getSubterm(0);
            v_9 = arg29.getSubterm(1);
            w_9 = arg29.getSubterm(2);
            x_9 = term;
            b_10 = term;
            y_9 = Doapply.const3;
            c_10 = b_10;
            term = termFactory.annotateTerm(termFactory.makeAppl(Doapply._consFunc_2, new IStrategoTerm[]{termFactory.annotateTerm(termFactory.makeAppl(Doapply._consVar_1, new IStrategoTerm[]{t_9}), checkListAnnos(termFactory, Doapply.constCons0)), Doapply.const4}), checkListAnnos(termFactory, Doapply.constCons0));
            z_9 = term;
            d_10 = c_10;
            term = termFactory.makeTuple(Doapply.const5, t_9, u_9, v_9, w_9);
            term = dr_set_rule_0_3.instance.invoke(context, d_10, y_9, z_9, term);
            if(term == null)
              break Fail19;
            term = x_9;
          }
          else
          { 
            break Fail19;
          }
        }
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class window_use_0_0 extends Strategy 
  { 
    public static window_use_0_0 instance = new window_use_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("window_use_0_0");
      Fail21:
      { 
        term = topdownstopping_1_0.instance.invoke(context, term, lifted20.instance);
        if(term == null)
          break Fail21;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class window_declarations_0_0 extends Strategy 
  { 
    public static window_declarations_0_0 instance = new window_declarations_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("window_declarations_0_0");
      Fail22:
      { 
        term = bottomup_1_0.instance.invoke(context, term, lifted21.instance);
        if(term == null)
          break Fail22;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class window_procedure_0_0 extends Strategy 
  { 
    public static window_procedure_0_0 instance = new window_procedure_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("window_procedure_0_0");
      Fail23:
      { 
        IStrategoTerm v_10 = null;
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consProcedure_5 != ((IStrategoAppl)term).getConstructor())
          break Fail23;
        v_10 = term;
        term = dr_scope_1_1.instance.invoke(context, v_10, lifted23.instance, Doapply.const3);
        if(term == null)
          break Fail23;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class add_loop_0_0 extends Strategy 
  { 
    public static add_loop_0_0 instance = new add_loop_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      ITermFactory termFactory = context.getFactory();
      context.push("add_loop_0_0");
      Fail24:
      { 
        IStrategoTerm y_10 = null;
        IStrategoTerm z_10 = null;
        IStrategoTerm a_11 = null;
        IStrategoTerm b_11 = null;
        IStrategoTerm c_11 = null;
        IStrategoTerm e_11 = null;
        IStrategoTerm f_11 = null;
        IStrategoTerm g_11 = null;
        IStrategoTerm h_11 = null;
        IStrategoTerm j_11 = null;
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consProcedure_5 != ((IStrategoAppl)term).getConstructor())
          break Fail24;
        y_10 = term.getSubterm(0);
        z_10 = term.getSubterm(1);
        a_11 = term.getSubterm(2);
        g_11 = term.getSubterm(3);
        h_11 = term.getSubterm(4);
        j_11 = term;
        term = argument_extreme_dimensions_0_0.instance.invoke(context, z_10);
        if(term == null)
          break Fail24;
        if(term.getTermType() != IStrategoTerm.TUPLE || term.getSubtermCount() != 4)
          break Fail24;
        b_11 = term.getSubterm(0);
        c_11 = term.getSubterm(1);
        e_11 = term.getSubterm(2);
        f_11 = term.getSubterm(3);
        term = j_11;
        Success4:
        { 
          Fail25:
          { 
            IStrategoTerm k_11 = null;
            k_11 = term;
            IStrategoTerm term6 = term;
            Success5:
            { 
              Fail26:
              { 
                term = oncetd_1_0.instance.invoke(context, term, lifted35.instance);
                if(term == null)
                  break Fail26;
                if(true)
                  break Success5;
              }
              term = oncetd_1_0.instance.invoke(context, term6, lifted36.instance);
              if(term == null)
                break Fail25;
            }
            term = k_11;
            { 
              term = termFactory.makeAppl(Doapply._consProcedure_5, new IStrategoTerm[]{y_10, z_10, a_11, termFactory.makeAppl(Doapply._consStatements_1, new IStrategoTerm[]{(IStrategoTerm)termFactory.makeListCons(termFactory.makeAppl(Doapply._consApplyLoop_6, new IStrategoTerm[]{Doapply.constRowColumn0, b_11, c_11, e_11, f_11, g_11}), (IStrategoList)Doapply.constNil0)}), h_11});
              if(true)
                break Success4;
            }
          }
          term = termFactory.makeAppl(Doapply._consProcedure_5, new IStrategoTerm[]{y_10, z_10, a_11, termFactory.makeAppl(Doapply._consStatements_1, new IStrategoTerm[]{(IStrategoTerm)termFactory.makeListCons(termFactory.makeAppl(Doapply._consApplyLoop_6, new IStrategoTerm[]{Doapply.constIndex0, b_11, c_11, e_11, f_11, g_11}), (IStrategoList)Doapply.constNil0)}), h_11});
        }
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class propagate_looptype_0_0 extends Strategy 
  { 
    public static propagate_looptype_0_0 instance = new propagate_looptype_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("propagate_looptype_0_0");
      Fail27:
      { 
        TermReference n_12 = new TermReference();
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consApplyLoop_6 != ((IStrategoAppl)term).getConstructor())
          break Fail27;
        if(n_12.value == null)
          n_12.value = term.getSubterm(0);
        else
          if(n_12.value != term.getSubterm(0) && !n_12.value.match(term.getSubterm(0)))
            break Fail27;
        lifted37 lifted370 = new lifted37();
        lifted370.n_12 = n_12;
        term = topdownstopping_1_0.instance.invoke(context, term, lifted370);
        if(term == null)
          break Fail27;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class add_type_0_1 extends Strategy 
  { 
    public static add_type_0_1 instance = new add_type_0_1();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term, IStrategoTerm k_30)
    { 
      ITermFactory termFactory = context.getFactory();
      Fail28:
      { 
        IStrategoTerm term7 = term;
        IStrategoConstructor cons1 = term.getTermType() == IStrategoTerm.APPL ? ((IStrategoAppl)term).getConstructor() : null;
        Success6:
        { 
          if(cons1 == Doapply._consWindowAccessScalar_2)
          { 
            Fail29:
            { 
              IStrategoTerm y_12 = null;
              IStrategoTerm z_12 = null;
              y_12 = term.getSubterm(0);
              z_12 = term.getSubterm(1);
              term = termFactory.makeAppl(Doapply._consWindowAccessScalar_3, new IStrategoTerm[]{y_12, z_12, k_30});
              if(true)
                break Success6;
            }
            term = term7;
          }
          if(cons1 == Doapply._consWindowAccessElement_6)
          { 
            IStrategoTerm p_12 = null;
            IStrategoTerm q_12 = null;
            IStrategoTerm r_12 = null;
            IStrategoTerm u_12 = null;
            IStrategoTerm v_12 = null;
            IStrategoTerm w_12 = null;
            p_12 = term.getSubterm(0);
            q_12 = term.getSubterm(1);
            r_12 = term.getSubterm(2);
            u_12 = term.getSubterm(3);
            v_12 = term.getSubterm(4);
            w_12 = term.getSubterm(5);
            term = termFactory.makeAppl(Doapply._consWindowAccessElement_7, new IStrategoTerm[]{p_12, q_12, r_12, u_12, v_12, w_12, k_30});
          }
          else
          { 
            break Fail28;
          }
        }
        if(true)
          return term;
      }
      context.push("add_type_0_1");
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class main_0_0 extends Strategy 
  { 
    public static main_0_0 instance = new main_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      context.push("main_0_0");
      Fail30:
      { 
        term = io_$Doapply_0_0.instance.invoke(context, term);
        if(term == null)
          break Fail30;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class $Procedure_5_0 extends Strategy 
  { 
    public static $Procedure_5_0 instance = new $Procedure_5_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term, Strategy b_17, Strategy c_17, Strategy d_17, Strategy e_17, Strategy f_17)
    { 
      ITermFactory termFactory = context.getFactory();
      context.push("Procedure_5_0");
      Fail31:
      { 
        IStrategoTerm w_114 = null;
        IStrategoTerm o_114 = null;
        IStrategoTerm r_114 = null;
        IStrategoTerm s_114 = null;
        IStrategoTerm u_114 = null;
        IStrategoTerm v_114 = null;
        IStrategoTerm x_114 = null;
        IStrategoTerm y_114 = null;
        IStrategoTerm z_114 = null;
        IStrategoTerm c_115 = null;
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consProcedure_5 != ((IStrategoAppl)term).getConstructor())
          break Fail31;
        o_114 = term.getSubterm(0);
        r_114 = term.getSubterm(1);
        s_114 = term.getSubterm(2);
        u_114 = term.getSubterm(3);
        v_114 = term.getSubterm(4);
        IStrategoList annos0 = term.getAnnotations();
        w_114 = annos0;
        term = b_17.invoke(context, o_114);
        if(term == null)
          break Fail31;
        x_114 = term;
        term = c_17.invoke(context, r_114);
        if(term == null)
          break Fail31;
        y_114 = term;
        term = d_17.invoke(context, s_114);
        if(term == null)
          break Fail31;
        z_114 = term;
        term = e_17.invoke(context, u_114);
        if(term == null)
          break Fail31;
        c_115 = term;
        term = f_17.invoke(context, v_114);
        if(term == null)
          break Fail31;
        term = termFactory.annotateTerm(termFactory.makeAppl(Doapply._consProcedure_5, new IStrategoTerm[]{x_114, y_114, z_114, c_115, term}), checkListAnnos(termFactory, w_114));
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class $Window$Scalar_0_0 extends Strategy 
  { 
    public static $Window$Scalar_0_0 instance = new $Window$Scalar_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      ITermFactory termFactory = context.getFactory();
      context.push("WindowScalar_0_0");
      Fail32:
      { 
        TermReference x_23 = new TermReference();
        TermReference y_23 = new TermReference();
        IStrategoTerm b_24 = null;
        IStrategoTerm d_24 = null;
        IStrategoTerm e_24 = null;
        if(x_23.value == null)
          x_23.value = term;
        else
          if(x_23.value != term && !x_23.value.match(term))
            break Fail32;
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consVar_1 != ((IStrategoAppl)term).getConstructor())
          break Fail32;
        if(y_23.value == null)
          y_23.value = term.getSubterm(0);
        else
          if(y_23.value != term.getSubterm(0) && !y_23.value.match(term.getSubterm(0)))
            break Fail32;
        d_24 = term;
        b_24 = Doapply.const1;
        term = d_24;
        e_24 = d_24;
        if(y_23.value == null)
          break Fail32;
        term = termFactory.annotateTerm(termFactory.makeAppl(Doapply._consVar_1, new IStrategoTerm[]{y_23.value}), checkListAnnos(termFactory, Doapply.constCons0));
        term = dr_lookup_rule_0_2.instance.invoke(context, e_24, b_24, term);
        if(term == null)
          break Fail32;
        lifted38 lifted380 = new lifted38();
        lifted380.y_23 = y_23;
        lifted380.x_23 = x_23;
        term = fetch_elem_1_0.instance.invoke(context, term, lifted380);
        if(term == null)
          break Fail32;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class aux_$Window$Scalar_0_2 extends Strategy 
  { 
    public static aux_$Window$Scalar_0_2 instance = new aux_$Window$Scalar_0_2();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term, IStrategoTerm f_24, IStrategoTerm g_24)
    { 
      ITermFactory termFactory = context.getFactory();
      Fail33:
      { 
        IStrategoTerm h_24 = null;
        IStrategoTerm i_24 = null;
        if(term.getTermType() != IStrategoTerm.TUPLE || term.getSubtermCount() != 3)
          break Fail33;
        IStrategoTerm arg32 = term.getSubterm(0);
        if(arg32.getTermType() != IStrategoTerm.STRING || !"175732".equals(((IStrategoString)arg32).stringValue()))
          break Fail33;
        h_24 = term.getSubterm(1);
        i_24 = term.getSubterm(2);
        term = termFactory.makeAppl(Doapply._consWindowAccessScalar_2, new IStrategoTerm[]{termFactory.makeAppl(Doapply._consVar_1, new IStrategoTerm[]{h_24}), i_24});
        if(true)
          return term;
      }
      context.push("aux_WindowScalar_0_2");
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class $Window$Element_0_0 extends Strategy 
  { 
    public static $Window$Element_0_0 instance = new $Window$Element_0_0();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      ITermFactory termFactory = context.getFactory();
      context.push("WindowElement_0_0");
      Fail34:
      { 
        TermReference r_29 = new TermReference();
        TermReference s_29 = new TermReference();
        TermReference t_29 = new TermReference();
        TermReference u_29 = new TermReference();
        IStrategoTerm x_29 = null;
        IStrategoTerm z_29 = null;
        IStrategoTerm a_30 = null;
        if(t_29.value == null)
          t_29.value = term;
        else
          if(t_29.value != term && !t_29.value.match(term))
            break Fail34;
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consFunc_2 != ((IStrategoAppl)term).getConstructor())
          break Fail34;
        IStrategoTerm arg33 = term.getSubterm(0);
        if(arg33.getTermType() != IStrategoTerm.APPL || Doapply._consVar_1 != ((IStrategoAppl)arg33).getConstructor())
          break Fail34;
        if(u_29.value == null)
          u_29.value = arg33.getSubterm(0);
        else
          if(u_29.value != arg33.getSubterm(0) && !u_29.value.match(arg33.getSubterm(0)))
            break Fail34;
        IStrategoTerm arg34 = term.getSubterm(1);
        if(arg34.getTermType() != IStrategoTerm.APPL || Doapply._consComma_2 != ((IStrategoAppl)arg34).getConstructor())
          break Fail34;
        if(r_29.value == null)
          r_29.value = arg34.getSubterm(0);
        else
          if(r_29.value != arg34.getSubterm(0) && !r_29.value.match(arg34.getSubterm(0)))
            break Fail34;
        if(s_29.value == null)
          s_29.value = arg34.getSubterm(1);
        else
          if(s_29.value != arg34.getSubterm(1) && !s_29.value.match(arg34.getSubterm(1)))
            break Fail34;
        z_29 = term;
        x_29 = Doapply.const3;
        term = z_29;
        a_30 = z_29;
        if(u_29.value == null)
          break Fail34;
        term = termFactory.annotateTerm(termFactory.makeAppl(Doapply._consFunc_2, new IStrategoTerm[]{termFactory.annotateTerm(termFactory.makeAppl(Doapply._consVar_1, new IStrategoTerm[]{u_29.value}), checkListAnnos(termFactory, Doapply.constCons0)), Doapply.const4}), checkListAnnos(termFactory, Doapply.constCons0));
        term = dr_lookup_rule_0_2.instance.invoke(context, a_30, x_29, term);
        if(term == null)
          break Fail34;
        lifted39 lifted390 = new lifted39();
        lifted390.u_29 = u_29;
        lifted390.r_29 = r_29;
        lifted390.s_29 = s_29;
        lifted390.t_29 = t_29;
        term = fetch_elem_1_0.instance.invoke(context, term, lifted390);
        if(term == null)
          break Fail34;
        context.popOnSuccess();
        if(true)
          return term;
      }
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") public static class aux_$Window$Element_0_4 extends Strategy 
  { 
    public static aux_$Window$Element_0_4 instance = new aux_$Window$Element_0_4();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term, IStrategoTerm b_30, IStrategoTerm c_30, IStrategoTerm d_30, IStrategoTerm e_30)
    { 
      ITermFactory termFactory = context.getFactory();
      Fail35:
      { 
        IStrategoTerm f_30 = null;
        IStrategoTerm g_30 = null;
        IStrategoTerm h_30 = null;
        IStrategoTerm i_30 = null;
        if(term.getTermType() != IStrategoTerm.TUPLE || term.getSubtermCount() != 5)
          break Fail35;
        IStrategoTerm arg35 = term.getSubterm(0);
        if(arg35.getTermType() != IStrategoTerm.STRING || !"-8183".equals(((IStrategoString)arg35).stringValue()))
          break Fail35;
        f_30 = term.getSubterm(1);
        g_30 = term.getSubterm(2);
        h_30 = term.getSubterm(3);
        i_30 = term.getSubterm(4);
        term = termFactory.makeAppl(Doapply._consWindowAccessElement_6, new IStrategoTerm[]{termFactory.makeAppl(Doapply._consVar_1, new IStrategoTerm[]{f_30}), c_30, d_30, g_30, h_30, i_30});
        if(true)
          return term;
      }
      context.push("aux_WindowElement_0_4");
      context.popOnFailure();
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted39 extends Strategy 
  { 
    TermReference u_29;

    TermReference r_29;

    TermReference s_29;

    TermReference t_29;

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail36:
      { 
        term = aux_$Window$Element_0_4.instance.invoke(context, term, u_29.value, r_29.value, s_29.value, t_29.value);
        if(term == null)
          break Fail36;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted38 extends Strategy 
  { 
    TermReference y_23;

    TermReference x_23;

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail37:
      { 
        term = aux_$Window$Scalar_0_2.instance.invoke(context, term, y_23.value, x_23.value);
        if(term == null)
          break Fail37;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted37 extends Strategy 
  { 
    TermReference n_12;

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail38:
      { 
        term = add_type_0_1.instance.invoke(context, term, n_12.value);
        if(term == null)
          break Fail38;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted36 extends Strategy 
  { 
    public static final lifted36 instance = new lifted36();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail39:
      { 
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consVar_1 != ((IStrategoAppl)term).getConstructor())
          break Fail39;
        IStrategoTerm arg31 = term.getSubterm(0);
        if(arg31.getTermType() != IStrategoTerm.STRING || !"column".equals(((IStrategoString)arg31).stringValue()))
          break Fail39;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted35 extends Strategy 
  { 
    public static final lifted35 instance = new lifted35();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail40:
      { 
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consVar_1 != ((IStrategoAppl)term).getConstructor())
          break Fail40;
        IStrategoTerm arg30 = term.getSubterm(0);
        if(arg30.getTermType() != IStrategoTerm.STRING || !"row".equals(((IStrategoString)arg30).stringValue()))
          break Fail40;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted23 extends Strategy 
  { 
    public static final lifted23 instance = new lifted23();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail41:
      { 
        IStrategoTerm x_10 = null;
        x_10 = term;
        term = dr_scope_1_1.instance.invoke(context, x_10, lifted24.instance, Doapply.const1);
        if(term == null)
          break Fail41;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted24 extends Strategy 
  { 
    public static final lifted24 instance = new lifted24();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail42:
      { 
        term = $Procedure_5_0.instance.invoke(context, term, _Id.instance, window_declarations_0_0.instance, _Id.instance, _Id.instance, _Id.instance);
        if(term == null)
          break Fail42;
        term = $Procedure_5_0.instance.invoke(context, term, _Id.instance, _Id.instance, _Id.instance, window_use_0_0.instance, _Id.instance);
        if(term == null)
          break Fail42;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted21 extends Strategy 
  { 
    public static final lifted21 instance = new lifted21();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail43:
      { 
        term = try_1_0.instance.invoke(context, term, window_declaration_0_0.instance);
        if(term == null)
          break Fail43;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted20 extends Strategy 
  { 
    public static final lifted20 instance = new lifted20();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail44:
      { 
        IStrategoTerm term4 = term;
        Success7:
        { 
          Fail45:
          { 
            term = $Window$Scalar_0_0.instance.invoke(context, term);
            if(term == null)
              break Fail45;
            if(true)
              break Success7;
          }
          term = $Window$Element_0_0.instance.invoke(context, term4);
          if(term == null)
            break Fail44;
        }
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted17 extends Strategy 
  { 
    public static final lifted17 instance = new lifted17();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail46:
      { 
        term = Doapply.const0;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted14 extends Strategy 
  { 
    public static final lifted14 instance = new lifted14();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail47:
      { 
        term = Doapply.const0;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted11 extends Strategy 
  { 
    public static final lifted11 instance = new lifted11();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail48:
      { 
        term = Doapply.const0;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted8 extends Strategy 
  { 
    public static final lifted8 instance = new lifted8();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail49:
      { 
        term = Doapply.const0;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted7 extends Strategy 
  { 
    TermReference l_8;

    TermReference m_8;

    TermReference n_8;

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail50:
      { 
        if(term.getTermType() != IStrategoTerm.APPL || Doapply._consWindowArray_3 != ((IStrategoAppl)term).getConstructor())
          break Fail50;
        if(l_8.value == null)
          l_8.value = term.getSubterm(0);
        else
          if(l_8.value != term.getSubterm(0) && !l_8.value.match(term.getSubterm(0)))
            break Fail50;
        if(m_8.value == null)
          m_8.value = term.getSubterm(1);
        else
          if(m_8.value != term.getSubterm(1) && !m_8.value.match(term.getSubterm(1)))
            break Fail50;
        if(n_8.value == null)
          n_8.value = term.getSubterm(2);
        else
          if(n_8.value != term.getSubterm(2) && !n_8.value.match(term.getSubterm(2)))
            break Fail50;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted4 extends Strategy 
  { 
    public static final lifted4 instance = new lifted4();

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail51:
      { 
        term = try_1_0.instance.invoke(context, term, window_procedure_0_0.instance);
        if(term == null)
          break Fail51;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted0 extends Strategy 
  { 
    Strategy s_7;

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail52:
      { 
        lifted1 lifted110 = new lifted1();
        lifted110.s_7 = s_7;
        term = try_1_0.instance.invoke(context, term, lifted110);
        if(term == null)
          break Fail52;
        if(true)
          return term;
      }
      return null;
    }
  }

  @SuppressWarnings("all") private static final class lifted1 extends Strategy 
  { 
    Strategy s_7;

    @Override public IStrategoTerm invoke(Context context, IStrategoTerm term)
    { 
      Fail53:
      { 
        term = topdownstopping_1_0.instance.invoke(context, term, s_7);
        if(term == null)
          break Fail53;
        if(true)
          return term;
      }
      return null;
    }
  }

  public static void registerInterop(org.spoofax.interpreter.core.IContext context, Context compiledContext)
  { 
    new InteropRegisterer().registerLazy(context, compiledContext, InteropRegisterer.class.getClassLoader());
  }

  @SuppressWarnings("unused") public static class InteropRegisterer extends org.strategoxt.lang.InteropRegisterer 
  { 
    @Override public void register(org.spoofax.interpreter.core.IContext context, Context compiledContext)
    { 
      register(context, compiledContext, context.getVarScope());
    }

    @Override public void registerLazy(org.spoofax.interpreter.core.IContext context, Context compiledContext, ClassLoader classLoader)
    { 
      registerLazy(context, compiledContext, classLoader, context.getVarScope());
    }

    private void register(org.spoofax.interpreter.core.IContext context, Context compiledContext, org.spoofax.interpreter.core.VarScope varScope)
    { 
      compiledContext.registerComponent("Doapply");
      Doapply.init(compiledContext);
      varScope.addSVar("topdownstopping_1_0", new InteropSDefT(topdownstopping_1_0.instance, context));
      varScope.addSVar("minstring_0_0", new InteropSDefT(minstring_0_0.instance, context));
      varScope.addSVar("maxstring_0_0", new InteropSDefT(maxstring_0_0.instance, context));
      varScope.addSVar("io_Doapply_0_0", new InteropSDefT(io_$Doapply_0_0.instance, context));
      varScope.addSVar("Apply__Doapply_0_0", new InteropSDefT($Apply__$Doapply_0_0.instance, context));
      varScope.addSVar("collect_windows_0_0", new InteropSDefT(collect_windows_0_0.instance, context));
      varScope.addSVar("select_rs_0_0", new InteropSDefT(select_rs_0_0.instance, context));
      varScope.addSVar("select_re_0_0", new InteropSDefT(select_re_0_0.instance, context));
      varScope.addSVar("select_cs_0_0", new InteropSDefT(select_cs_0_0.instance, context));
      varScope.addSVar("select_ce_0_0", new InteropSDefT(select_ce_0_0.instance, context));
      varScope.addSVar("min_rs_0_0", new InteropSDefT(min_rs_0_0.instance, context));
      varScope.addSVar("max_re_0_0", new InteropSDefT(max_re_0_0.instance, context));
      varScope.addSVar("min_cs_0_0", new InteropSDefT(min_cs_0_0.instance, context));
      varScope.addSVar("max_ce_0_0", new InteropSDefT(max_ce_0_0.instance, context));
      varScope.addSVar("collection_extreme_dimensions_0_0", new InteropSDefT(collection_extreme_dimensions_0_0.instance, context));
      varScope.addSVar("argument_extreme_dimensions_0_0", new InteropSDefT(argument_extreme_dimensions_0_0.instance, context));
      varScope.addSVar("window_declaration_0_0", new InteropSDefT(window_declaration_0_0.instance, context));
      varScope.addSVar("window_use_0_0", new InteropSDefT(window_use_0_0.instance, context));
      varScope.addSVar("window_declarations_0_0", new InteropSDefT(window_declarations_0_0.instance, context));
      varScope.addSVar("window_procedure_0_0", new InteropSDefT(window_procedure_0_0.instance, context));
      varScope.addSVar("add_loop_0_0", new InteropSDefT(add_loop_0_0.instance, context));
      varScope.addSVar("propagate_looptype_0_0", new InteropSDefT(propagate_looptype_0_0.instance, context));
      varScope.addSVar("add_type_0_1", new InteropSDefT(add_type_0_1.instance, context));
      varScope.addSVar("main_0_0", new InteropSDefT(main_0_0.instance, context));
      varScope.addSVar("Procedure_5_0", new InteropSDefT($Procedure_5_0.instance, context));
      varScope.addSVar("WindowScalar_0_0", new InteropSDefT($Window$Scalar_0_0.instance, context));
      varScope.addSVar("aux_WindowScalar_0_2", new InteropSDefT(aux_$Window$Scalar_0_2.instance, context));
      varScope.addSVar("WindowElement_0_0", new InteropSDefT($Window$Element_0_0.instance, context));
      varScope.addSVar("aux_WindowElement_0_4", new InteropSDefT(aux_$Window$Element_0_4.instance, context));
    }

    private void registerLazy(org.spoofax.interpreter.core.IContext context, Context compiledContext, ClassLoader classLoader, org.spoofax.interpreter.core.VarScope varScope)
    { 
      compiledContext.registerComponent("Doapply");
      Doapply.init(compiledContext);
      varScope.addSVar("topdownstopping_1_0", new InteropSDefT(classLoader, "Doapply$topdownstopping_1_0", context));
      varScope.addSVar("minstring_0_0", new InteropSDefT(classLoader, "Doapply$minstring_0_0", context));
      varScope.addSVar("maxstring_0_0", new InteropSDefT(classLoader, "Doapply$maxstring_0_0", context));
      varScope.addSVar("io_Doapply_0_0", new InteropSDefT(classLoader, "Doapply$io_$Doapply_0_0", context));
      varScope.addSVar("Apply__Doapply_0_0", new InteropSDefT(classLoader, "Doapply$$Apply__$Doapply_0_0", context));
      varScope.addSVar("collect_windows_0_0", new InteropSDefT(classLoader, "Doapply$collect_windows_0_0", context));
      varScope.addSVar("select_rs_0_0", new InteropSDefT(classLoader, "Doapply$select_rs_0_0", context));
      varScope.addSVar("select_re_0_0", new InteropSDefT(classLoader, "Doapply$select_re_0_0", context));
      varScope.addSVar("select_cs_0_0", new InteropSDefT(classLoader, "Doapply$select_cs_0_0", context));
      varScope.addSVar("select_ce_0_0", new InteropSDefT(classLoader, "Doapply$select_ce_0_0", context));
      varScope.addSVar("min_rs_0_0", new InteropSDefT(classLoader, "Doapply$min_rs_0_0", context));
      varScope.addSVar("max_re_0_0", new InteropSDefT(classLoader, "Doapply$max_re_0_0", context));
      varScope.addSVar("min_cs_0_0", new InteropSDefT(classLoader, "Doapply$min_cs_0_0", context));
      varScope.addSVar("max_ce_0_0", new InteropSDefT(classLoader, "Doapply$max_ce_0_0", context));
      varScope.addSVar("collection_extreme_dimensions_0_0", new InteropSDefT(classLoader, "Doapply$collection_extreme_dimensions_0_0", context));
      varScope.addSVar("argument_extreme_dimensions_0_0", new InteropSDefT(classLoader, "Doapply$argument_extreme_dimensions_0_0", context));
      varScope.addSVar("window_declaration_0_0", new InteropSDefT(classLoader, "Doapply$window_declaration_0_0", context));
      varScope.addSVar("window_use_0_0", new InteropSDefT(classLoader, "Doapply$window_use_0_0", context));
      varScope.addSVar("window_declarations_0_0", new InteropSDefT(classLoader, "Doapply$window_declarations_0_0", context));
      varScope.addSVar("window_procedure_0_0", new InteropSDefT(classLoader, "Doapply$window_procedure_0_0", context));
      varScope.addSVar("add_loop_0_0", new InteropSDefT(classLoader, "Doapply$add_loop_0_0", context));
      varScope.addSVar("propagate_looptype_0_0", new InteropSDefT(classLoader, "Doapply$propagate_looptype_0_0", context));
      varScope.addSVar("add_type_0_1", new InteropSDefT(classLoader, "Doapply$add_type_0_1", context));
      varScope.addSVar("main_0_0", new InteropSDefT(classLoader, "Doapply$main_0_0", context));
      varScope.addSVar("Procedure_5_0", new InteropSDefT(classLoader, "Doapply$$Procedure_5_0", context));
      varScope.addSVar("WindowScalar_0_0", new InteropSDefT(classLoader, "Doapply$$Window$Scalar_0_0", context));
      varScope.addSVar("aux_WindowScalar_0_2", new InteropSDefT(classLoader, "Doapply$aux_$Window$Scalar_0_2", context));
      varScope.addSVar("WindowElement_0_0", new InteropSDefT(classLoader, "Doapply$$Window$Element_0_0", context));
      varScope.addSVar("aux_WindowElement_0_4", new InteropSDefT(classLoader, "Doapply$aux_$Window$Element_0_4", context));
    }
  }
}